import { useContext, useEffect, useMemo, useState } from 'react';
import { Tabs, Button, message, Spin, Input, Space, Badge } from 'antd';
import _ from 'lodash';
import Cls from 'classnames';
import moment from 'moment';
import { useForm } from 'antd/lib/form/Form';

import MyIcon from '@/components/MyIcon';
import { ILoadMapTypeAll } from '@/common';
import CustomPaging from '@/components/CustomPaging';
import { UploadFormCommon } from '@/components/UploadForm';
import ScrollBarLayout from '@/components/ScrollBarLayout';
import { TipsErrorModalNew } from '@/components/TipsErrorModalNew';
import { TagSelectNew as TagSelect } from '@/components/TagSelectNew';
import { Descriptions, useDescriptions } from '@/components/Descriptions';
import {
  getUserName,
  getUserDepName,
  getPersonalInfo,
  getTenantID,
  getFileNameByPath,
  downloadTemplate,
  newGetFileNameNotType,
  getUserID,
  getUserDepID,
  getInvoiceCode,
} from '@/utils';

import { updateClarifyBtn } from '../mconfig';
import { IUpdateEnum } from '../common/UpdateReducer';
import { BUSINESS_TYPE, CQXG_STATE } from '../common/Format';
import { SourceUpdateContext } from '../common/UpdateContext';
import { addClarifySerivice, editClarifySerivice, getPackClarifySerivice, deleteClarifySerivice, getClarifyServices } from '../services/UpdateService';
import { RevokeModal } from '../../Acomponents/RevokeModal';

/**
 * @UpdateSourceClarifyView 澄清修改组件
 * @returns
 */
const UpdateSourceClarifyView = () => {
  /**上下文*/
  const { Invite_PackList, Source_Invite, Source_Clarify, curRes, locationProps, dispatch } = useContext(SourceUpdateContext);
  /**获取路由信息*/
  const { type, info } = locationProps?.state || {};
  /** 详情返回的澄清数据集合 */
  const [clarifyList, setClarifyList] = useState<any[]>([]);
  /** tab选择项 */
  const [selectKey, setSelectKey] = useState<string>(Invite_PackList?.[0]?.id);
  /** 保存选择标包的下标 */
  const [PackIndex, setPackIndex] = useState<number>(0);
  /** 总页数 */
  const [total, setTotal] = useState<number>(1);
  /** 当前页数 */
  const [current, setCurrent] = useState<number>(1);
  /** 删除弹窗 */
  const [isShowDelModal, setIsShowDelModal] = useState<Record<string, any>>({
    isShow: false,
    resObj: null,
  });
  /**撤销弹窗*/
  const [invalidState, setInvalidState] = useState<Record<string, any>>({});

  /** 澄清按钮权限 */
  const isShowBtn = useMemo(() => {
    return updateClarifyBtn(curRes, Source_Clarify, Invite_PackList[PackIndex]);
  }, [curRes, Invite_PackList, PackIndex, Source_Clarify]);

  /** 表格form对象 */
  const [clarifyForm] = useForm();

  /** 表格配置 */
  const [config, methods] = useDescriptions({
    name: 'source-clarify',
    labelWidth: 230,
    schemas: [
      {
        label: '一、项目信息',
        field: 'title',
        component: 'Title',
      },
      {
        label: '采购项目名称',
        field: 'purchProjectName',
        component: 'Input',
        disabled: true,
        placeholder: '请输入',
      },
      {
        label: '流水单号',
        field: 'clarifyCode',
        component: 'Input',
        disabled: true,
        placeholder: '自动带出',
        // initialValue: getInvoiceCode('CQ'),
      },
      {
        label: '澄清提出日期',
        field: 'bidBeginTime',
        component: 'DatePicker',
        placeholder: type == 'detail' ? '--' : '请选择',
        disabled: !(isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail'),
        required: true,
        message: '请选择澄清提出日期',
        disabledDate: (current: any) => {
          return current && current > moment(Source_Invite?.extensionBidClearTime).startOf('days');
        },
      },
      {
        label: '澄清截止日期',
        field: 'bidClearTime',
        component: 'DatePicker',
        placeholder: type == 'detail' ? '--' : '请选择',
        disabled: true,
        message: '请暂存招标公告澄清截止日期',
      },
      {
        label: '联系人',
        field: 'dutyerName',
        component: 'Input',
        placeholder: '自动带出',
        message: '自动带出',
        disabled: !(isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail'),
      },
      {
        label: '联系电话',
        field: 'dutyPhone',
        component: 'Input',
        placeholder: '自动带出',
        message: '自动带出',
        disabled: !(isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail'),
      },
      {
        label: '承办部门',
        field: 'dutyDepartmentName',
        component: 'Input',
        placeholder: '自动带出',
        message: '自动带出',
        disabled: !(isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail'),
      },
      {
        label: '是否影响投标文件编制',
        field: 'effectFlag',
        component: 'Render',
        required: true,
        disabled: !(isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail'),
        slotRender: (text: string = '0') => {
          if (!(isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail')) {
            return <span style={{ marginLeft: '8px' }}>{text == '1' ? '是' : '否'}</span>;
          }
          return (
            <TagSelect
              colSpan={24}
              formLabel={''}
              formName={'effectFlag'}
              radioDisabled={!(isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail')}
              defalultKeys={Number(text)}
              radioList={[
                {
                  value: 1,
                  name: '是',
                },
                {
                  value: 0,
                  name: '否',
                },
              ]}
            />
          );
        },
      },
      {
        label: '二、澄清说明',
        field: 'title',
        component: 'Title',
      },
      {
        label: '变更前内容', // 未找到
        field: 'preContent',
        component: 'InputTextArea',
        placeholder: type == 'detail' ? '--' : '请输入',
        maxLength: 800,
        allowClear: true,
        autoSize: { minRows: 5, maxRows: 7 },
        showCount: true,
        colSpan: 2,
        required: true,
        message: '请输入变更前内容',
        disabled: !(isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail'),
      },
      {
        label: '变更后内容', // 未找到
        field: 'afterContent',
        component: 'InputTextArea',
        placeholder: type == 'detail' ? '--' : '请输入',
        maxLength: 800,
        allowClear: true,
        autoSize: { minRows: 5, maxRows: 7 },
        showCount: true,
        colSpan: 2,
        required: true,
        message: '请输入变更后内容',
        disabled: !(isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail'),
      },
      {
        label: '澄清附件',
        field: 'attachURL',
        component: 'Render',
        colSpan: 2,
        required: true,
        message: '请上传澄清附件',
        slotRender: (text: string, record: Record<string, any>) => {
          if (!(isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail')) {
            const fileName = text ? getFileNameByPath(text) : '';
            return (
              <div style={{ width: '100%', display: 'flex', justifyContent: 'space-between', padding: 10 }}>
                {fileName ? (
                  <>
                    <a
                      onClick={() => {
                        downloadTemplate('/purchaseSourceClarifyController/downloadFile', fileName, record?.attachURL, () => {});
                      }}
                    >
                      {/* {fileName} */}
                      <MyIcon type="icon-file-text-fill" />
                      &nbsp;
                      {newGetFileNameNotType(fileName, 7)}
                    </a>
                  </>
                ) : (
                  <Input disabled={true} placeholder="--" />
                )}
              </div>
            );
          } else {
            return (
              <div style={{ paddingRight: 8 }}>
                <UploadFormCommon
                  form={clarifyForm}
                  fileFormName={'attachURL'}
                  spanCol={24}
                  inRowProportion={24}
                  name={'attachFile'}
                  required={true}
                  accept={'.doc|.docx|.pdf'}
                  url={'/purchaseSourceClarifyController/uploadFile'}
                  downloadUrl={'/purchaseSourceClarifyController/downloadFile'}
                  fileFormDelName={'delLicenceUrl'}
                  delFunc={() => {}}
                  maxFile={1}
                  defaultFiles={text}
                  hintTitle={'如上传多个，只保留第一个！'}
                  fieldBusiPath={'purchase/clarify'}
                >
                  上传
                </UploadFormCommon>
              </div>
            );
          }
        },
      },
    ],
    basicForm: clarifyForm,
  });

  /** 保存澄清详情 */
  const saveClarifyDetail = (info: Record<string, any>) => {
    dispatch({
      type: IUpdateEnum.Set_Source_Clarify,
      payload: info,
    });
  };

  /** 组件抛出方法 */
  const SourceClarifyMethods = {
    setProjectInfo: (info: Record<string, any>) => {
      const param = {
        ...info,
        dutyPhone: getPersonalInfo()?.phoneMobile || '',
        dutyerName: getUserName(),
        dutyDepartmentName: getUserDepName(),
      };
      methods?.setFieldsValue(param);
    },
    ...methods,
  };

  /** 改变分页方法 */
  const changePage = (opertae: string) => {
    let newCurrent = 0;
    if (opertae == 'next') {
      newCurrent = current + 1;
    } else {
      newCurrent = current - 1;
    }
    setCurrent(newCurrent);
    if (clarifyList?.length > 0) {
      if (clarifyList[newCurrent - 1]?.id) {
        getClarifyRun({ id: clarifyList[newCurrent - 1]?.id });
      } else {
        saveClarifyDetail(clarifyList[newCurrent - 1]);
      }
    }
  };

  /** reducer中的 每个澄清对象来渲染 */
  useEffect(() => {
    if (Source_Clarify) {
      clarifyForm?.setFieldsValue({
        ...Source_Clarify,
        purchProjectName: Source_Clarify?.purchProjectName,
        // purchProjectCode: Source_Clarify?.purchProjectCode,
        clarifyCode: Source_Clarify?.clarifyCode,
        bidClearTime: Source_Clarify?.bidClearTime ? moment(Source_Clarify?.bidClearTime) : null,
        bidBeginTime: Source_Clarify?.bidBeginTime ? moment(Source_Clarify?.bidBeginTime) : null,
        dutyerName: getUserName(),
        dutyDepartmentName: getUserDepName(),
      });
    }
  }, [Source_Clarify]);

  /** 澄清分页变化时  切换数据*/
  useEffect(() => {
    if (clarifyList?.length > 0) {
      if (clarifyList[current - 1]?.id) {
        getClarifyRun({ id: clarifyList[current - 1]?.id });
      } else {
        saveClarifyDetail(clarifyList[current - 1]);
      }
    }
  }, [clarifyList, current]);

  /** 列表澄清 */
  const { getPackClarifyRun, getPackClarifyLoading } = getPackClarifySerivice((res, { totalNum, currentNum }, bol) => {
    if (res?.msgFlag) {
      // 没有澄清的数据,给表单默认的一些内容
      let paramsInfo: Record<string, any> = {};
      setClarifyList(res?.rows);

      if (res?.rows?.length) {
        let result = res?.rows?.[current - 1];
        setSelectKey(res?.rows?.[current - 1]?.sourceID);

        paramsInfo = {
          ...result,
          purchProjectName: Source_Invite?.purchProjectName,
          bidClearTime: result?.bidClearTime ? moment(result?.bidClearTime) : null,
          bidBeginTime: result?.bidBeginTime ? moment(result?.bidBeginTime) : null,
          dutyerName: getUserName(),
          dutyDepartmentName: getUserDepName(),
        };
        methods?.setFieldsValue(paramsInfo);

        if (bol) {
          setTotal(totalNum);
          setCurrent(currentNum);
        } else {
          setTotal(res?.rows?.length);
          setCurrent(1);
        }

        getClarifyRun({ id: paramsInfo?.id });
      } else {
        clarifyForm?.resetFields(); // 重置表单
        paramsInfo = {
          purchProjectName: Source_Invite?.purchProjectName,
          bidClearTime: Source_Invite?.extensionBidClearTime ? moment(Source_Invite?.extensionBidClearTime) : null,
          dutyPhone: getPersonalInfo()?.phoneMobile || '',
          dutyerID: getUserName(),
          dutyDepartmentID: getUserDepName(),
          clarifyCode: getInvoiceCode('CQ'),
        };
        setCurrent(1);
        setTotal(1);
        saveClarifyDetail(paramsInfo);
      }
    } else {
      message?.error(res?.msg);
    }
  }, curRes);

  /** 详情澄清 */
  const { getClarifyRun, getClarifyLoading } = getClarifyServices((res) => {
    if (res?.msgFlag) {
      message?.success(res?.msg);
      saveClarifyDetail(res?.obj);
    }
  });

  /** 添加澄清 */
  const { addClarifyRun, addClarifyLoading } = addClarifySerivice((res) => {
    if (res?.msgFlag) {
      message?.success(res?.msg);
      getPackClarifyRun({ sourceID: selectKey }, Number(total), Number(current));
    } else {
      message.error(res?.msg);
    }
  });

  /** 编辑澄清 */
  const { editClarifyRun, editClarifyLoading } = editClarifySerivice((res) => {
    if (res?.msgFlag) {
      message?.success(res?.msg);
      getPackClarifyRun({ sourceID: selectKey }, Number(total), Number(current));
    } else {
      message.error(res?.msg);
    }
  });

  /** 删除澄清 */
  const { deleteClarifyRun, deleteClarifyLoading } = deleteClarifySerivice((res) => {
    if (res?.msgFlag) {
      message?.success(res?.msg);
      setCurrent(current - 1 || 1);
      setTotal(total - 1 || 1);
      getPackClarifyRun({ sourceID: selectKey }, Number(total - 1), Number(current - 1));
    } else {
      message.error(res?.msg);
    }
  });

  /** 刷新详情 */
  const reloadClarifyDetail = (info: Record<string, any>) => {
    getClarifyRun({ id: clarifyList[current - 1]?.id });
  };

  useEffect(() => {
    if (Invite_PackList?.[0]?.id) {
      const selectedInfo = Invite_PackList?.find((item) => item?.id === info?.id);
      const result = Invite_PackList?.find((item) => item?.id == selectKey);
      /** 切换头部的步骤条到公告时可能因为数据返回的格式改变了拟定采购方式和下方table的数据，从而改变reducer中的【Invite_SaveData】 */
      if (!result) {
        /** 采购实施管理页点击澄清按钮或者查看详情进来后默认选中对应的包-左侧tab栏 */
        if (selectedInfo?.id) {
          setSelectKey(selectedInfo?.id);
          return;
        }
        setSelectKey(Invite_PackList?.[0]?.id);
      } else {
        setSelectKey(result?.id);
      }
    }
  }, [Invite_PackList]);

  useEffect(() => {
    if (selectKey) {
      getPackClarifyRun({ sourceID: selectKey }, 0, 0, false); // 详情接口
    }
  }, [selectKey]);

  // 澄清截至日期
  useEffect(() => {
    if (Source_Invite?.id && Source_Invite?.extensionBidClearTime) {
      methods?.setFieldsValue({ bidClearTime: moment(Source_Invite?.extensionBidClearTime) });
    }
  }, [Source_Invite]);

  /** 添加澄清修改 */
  const addSourceClarify = async () => {
    let { id: sourceID, applyID, projectID, projectCode, projectName, projectSum, purchProjectName, purchProjectCode } = Source_Invite;
    const formResult = await methods?.validateFields();

    const result = {
      ...formResult,
      applyID,
      projectID,
      projectCode,
      projectName,
      projectSum,
      purchProjectName,
      purchProjectCode,
      sourceID,
      packID: selectKey,
      orderType: `${getTenantID()}${ILoadMapTypeAll.ALLORDER_TYPE}1012`,
    };

    if (result?.bidClearTime) {
      result.bidClearTime = moment(result?.bidClearTime).format('YYYY-MM-DD 00:00:00');
    }
    if (result?.bidBeginTime) {
      result.bidBeginTime = moment(result?.bidBeginTime).format('YYYY-MM-DD 00:00:00');
    }

    setTotal(total + 1);
    setCurrent(total + 1);

    let newData: any[] = clarifyList?.length > 0 ? _?.cloneDeep(clarifyList) : [];

    newData.push({
      // ...result,
      bidBeginTime: null,
      preContent: null,
      afterContent: null,
      attachURL: null,
      delLicenceUrl: null,
      state: null,
      purchProjectName: Source_Invite?.purchProjectName,
      purchProjectCode: Source_Invite?.purchProjectCode,
      bidClearTime: Source_Invite?.extensionBidClearTime ? moment(Source_Invite?.extensionBidClearTime) : null,
      clarifyCode: getInvoiceCode('CQ'),
      dutyPhone: getPersonalInfo()?.phoneMobile || '',
      dutyerID: getUserName(),
      dutyDepartmentID: getUserDepName(),
    });

    setClarifyList(newData);
  };

  /** 添加澄清删除 */
  const deleteSourceClarify = () => {
    if (Source_Clarify?.id) {
      /**有id可以删除*/
      deleteClarifyRun({
        id: Source_Clarify?.id,
        versionNum: Source_Clarify?.versionNum,
      });
      return;
    }

    /**无id可以删除*/
    if (total == 1) {
      setTotal(1);
      setCurrent(1);
      setClarifyList([]);
      return;
    }

    setTotal(total - 1);
    setCurrent(current - 1);
    clarifyList.splice(current - 1, 1);
  };

  /** 暂存按钮事件 */
  const onSave = async () => {
    let { applyID, projectID, projectCode, projectName, projectSum, purchProjectName, purchProjectCode } = Source_Invite;
    const select_obj = Invite_PackList?.find((item) => item?.id == selectKey);
    const formResult = await methods?.validateFields();

    const result = {
      ...formResult,
      dutyerID: getUserID(),
      dutyDepartmentID: getUserDepID(),
      applyID,
      projectID,
      projectCode,
      projectName,
      projectSum,
      purchProjectName,
      purchProjectCode,
      sourceID: select_obj?.id,
      packID: select_obj?.packID,
      businessType: BUSINESS_TYPE(),
      orderType: `${getTenantID()}${ILoadMapTypeAll.ALLORDER_TYPE}1012`,
    };

    if (result?.bidClearTime) {
      result.bidClearTime = moment(result?.bidClearTime).format('YYYY-MM-DD 00:00:00');
    }
    if (result?.bidBeginTime) {
      result.bidBeginTime = moment(result?.bidBeginTime).format('YYYY-MM-DD 00:00:00');
    }
    // 判断是【新增】还是【编辑】
    if (Source_Clarify?.id) {
      // 编辑
      const editPayload: Record<string, any> = {
        ...result,
        id: Source_Clarify?.id,
        versionNum: Source_Clarify?.versionNum,
        // applyerID: Source_Clarify?.applyerID,
        // applyPositionID: Source_Clarify?.applyPositionID,
        // applyDepartmentID: Source_Clarify?.applyDepartmentID,
        // applyCompanyID: Source_Clarify?.applyCompanyID,
      };

      editClarifyRun(editPayload, false);
    } else {
      // 新增
      const addPayload: Record<string, any> = {
        ...result,
        state: `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1000`,
      };
      addClarifyRun(addPayload, false);
    }
  };

  // 返回招标文件澄清修改的表单
  const container = () => {
    return (
      <div className={'source-clarify'}>
        <Spin spinning={getPackClarifyLoading || addClarifyLoading || editClarifyLoading || deleteClarifyLoading || getClarifyLoading}>
          {Invite_PackList?.length > 0 && (
            <div className={Cls('source-clarify-tabs', 'source-tabs-color')}>
              <Tabs
                tabPosition={'left'}
                items={Invite_PackList.map((item, i) => {
                  return {
                    label: item?.packCode,
                    key: item?.id,
                  };
                })}
                defaultActiveKey={Invite_PackList?.[0]?.id}
                onChange={(value) => {
                  setSelectKey(value);
                  setPackIndex(Invite_PackList?.findIndex((item) => item?.id == value));
                }}
                activeKey={selectKey}
                destroyInactiveTabPane={true}
              />
            </div>
          )}

          <ScrollBarLayout>
            <div className={'source-clarify-desc'}>
              <Badge.Ribbon
                text={
                  Source_Clarify?.id && Source_Clarify?.state != `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1000`
                    ? Source_Clarify?.state == `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1001`
                      ? '审核中'
                      : Source_Clarify?.state == `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1002`
                      ? '审核通过'
                      : Source_Clarify?.state == `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1003`
                      ? '作废'
                      : '起草'
                    : '起草'
                }
                color={
                  Source_Clarify?.id && Source_Clarify?.state != `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1000`
                    ? Source_Clarify?.state == `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1001`
                      ? '#F39C12'
                      : Source_Clarify?.state == `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1002`
                      ? '#2ECC71'
                      : Source_Clarify?.state == `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1003`
                      ? '#E74C3C'
                      : '#3498DB'
                    : '#3498DB'
                }
              >
                <Descriptions config={config} />
              </Badge.Ribbon>

              {/* 分页配置 */}
              <CustomPaging
                current={current}
                total={total}
                onChange={(opertae) => {
                  changePage(opertae);
                }}
              />
            </div>
          </ScrollBarLayout>
        </Spin>

        {isShowDelModal?.isShow && (
          <TipsErrorModalNew
            onClose={() => {
              setIsShowDelModal({ isShow: false, resObj: null });
            }}
            modalOnOK={deleteSourceClarify}
            modalLoading={deleteClarifyLoading}
            modalTip={'确认删除此条澄清吗？此操作不可恢复！'}
          />
        )}

        {invalidState?.isShow && (
          <RevokeModal
            resObj={invalidState?.resObj}
            revokeRequestUrl={'/purchaseSourceClarifyController/invalid'}
            onClose={() => setInvalidState({})}
            reqBody={{ state: `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1000` }}
            modalTip={
              <div style={{ color: '#000' }}>
                确认是否撤销【<span style={{ color: 'red' }}>{invalidState?.resObj?.purchProjectName}</span>】的审核, 撤销后可重新提交！
              </div>
            }
            reloadRequest={() => getPackClarifyRun({ sourceID: selectKey }, total, current)}
          />
        )}
      </div>
    );
  };

  // 底部操作
  const btnFooter = () => {
    return (
      <Space>
        {isShowBtn?.clarifySaveBtn && Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail' && (
          <Button type="primary" onClick={onSave}>
            暂存
          </Button>
        )}
        {Invite_PackList[PackIndex]?.state == CQXG_STATE() && type != 'detail' && curRes?.['/purchaseSourceClarifyController/add'] && (
          <Button type="primary" onClick={addSourceClarify}>
            添加
          </Button>
        )}
        {curRes?.['/purchaseSourceClarifyController/delClarify'] &&
          Invite_PackList[PackIndex]?.state == CQXG_STATE() &&
          clarifyList?.length != 0 &&
          ((Source_Clarify?.state && !Source_Clarify?.checkState) || !Source_Clarify?.id) &&
          type != 'detail' && (
            <Button
              type="primary"
              danger
              // icon={<CloseCircleOutlined />}
              onClick={() => {
                setIsShowDelModal({ isShow: true, resObj: {} });
              }}
            >
              删除
            </Button>
          )}
      </Space>
    );
  };

  return {
    UpdateSourceClarify: container,
    SourceClarifyFooter: btnFooter,
    SourceClarifyMethods,
    reloadClarifyDetail,
  };
};

export default UpdateSourceClarifyView;
{
  /* {Invite_PackList[PackIndex]?.state == CQXG_STATE() &&
          (Source_Clarify?.state == `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1001` ||
            (Source_Clarify?.state == `${getTenantID()}${ILoadMapTypeAll.PROCURECLARFY_STATE}1001` && Source_Clarify?.checkState == SHTH_CHECKSTATE())) &&
          Source_Clarify?.applyerID == getUserID() &&
          Source_Clarify?.applyPositionID == getPosIDs() &&
          curRes?.['/purchaseSourceClarifyController/invalid'] && (
            <Button
              type="primary"
              danger
              // icon={<RollbackOutlined />}
              onClick={() => {
                setInvalidState({ isShow: true, resObj: Source_Clarify });
              }}
            >
              撤销
            </Button>
          )} */
}
